<?php
/**
 * @version $Date$
 * @author Payment Network AG integration@payment-network.com
 * @link http://www.sofort.com/
 *
 * Copyright (c) 2012 Payment Network AG
 *
 * $Id$
 */
chdir('../../../../');
require_once('includes/application_top.php');

//check if admin
if ($_SESSION['customers_status']['customers_status_id'] == '0') {
require_once(dirname(__FILE__).'/../../library/sofortLib.php');
	preg_match('#([a-zA-Z0-9:]+)#', $_GET['k'], $matches);
	$configkey =  $matches[1];
	$sofort = new SofortLib_TransactionData($configkey);
	$sofort->setTransaction('00000')->sendRequest();
	
	if($sofort->isError()) {
		echo -1;
	} else {
		echo 1;
	}
}